package com.ordobill.webapp.common;

import java.io.*;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.*;

import oracle.jdbc.driver.OracleDriver;

public class SqlMapClientManager {
	
	private static final SqlMapClient sqlMap;
	
	static{ 
		try{ 
			String resource = "../sqlMap-config.xml";
			Reader reader = Resources.getResourceAsReader(resource);
			sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
		}catch(Exception e) {
			e.printStackTrace();
			throw new RuntimeException("Error initializing SqlMapClientManager class. Cause: " + e);
		}
	}
	
	public static SqlMapClient getSqlMapClient(){
		return sqlMap;
	}

}
